package com.yanqu.road.server.cmd.wineshop;

import com.yanqu.road.pb.wineshop.WineShopProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.wineshop.WineShopModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.GameProtocol;

/**
 * @author ：zfr
 * @date ：2021/7/29 15:18
 */
@Cmd(code = GameProtocol.S_WINESHOP_OFFLINE_RECEPTION, desc = "酒肆离线招待美女")
public class WineShopOffLineReceptionCmd extends AbstractCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        player.getModule(WineShopModule.class).offLineReception();
    }

    @Override
    public void sendData(GamePlayer player) {
        WineShopProto.WineShopOffLineReceptionRespMsg.Builder respMsg = WineShopProto.WineShopOffLineReceptionRespMsg.newBuilder();
        respMsg.setRet(0);
        player.sendPacket(ClientProtocol.U_WINESHOP_OFFLINE_RECEPTION, respMsg);
    }
}
